package com.bo.wei.chen.mybatis.service.impl;

import com.bo.wei.chen.mybatis.mapper.StudentMapper;
import com.bo.wei.chen.mybatis.model.Student;
import com.bo.wei.chen.mybatis.model.StudentDTO;
import com.bo.wei.chen.mybatis.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author DELL
 */
@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;

    /**
     * 查询全部
     *
     * @return List<Student>
     */
    @Override
    public List<Student> select() {
        return studentMapper.select();
    }

    /**
     * 查询全部
     *
     * @param studentDTO
     * @return List<Student>
     */
    @Override
    public List<Student> selectByExample(StudentDTO studentDTO) {
        return studentMapper.selectByExample(studentDTO);
    }

    /**
     * 增加
     *
     * @param student 条件
     * @return int
     */
    @Override
    public int add(Student student) {
        return studentMapper.add(student);
    }

    /**
     * 修改
     *
     * @param student 条件
     *
     * @return int
     */
    @Override
    public int update(Student student) {
        return studentMapper.update(student);
    }

    /**
     * 删除
     *
     * @param id 条件
     *
     * @return int
     */
    @Override
    public int delete(int id) {
        return studentMapper.delete(id);
    }
}
